exports.addCategory = (req,res) => {

    var bodyParams = req.routeInfo.bodyParams;

    //新增文档分类
    var sql = "insert into docs_category values(NULL,'" + bodyParams.dc_name + "')";

    sqliteDb.run(sql,function(error,data){

        if(error){
            return RES.errorResponse(res,"抱歉，文档分类新增失败");
        }

        //获取新增的主键ID
        sql = "select last_insert_rowid() as lastId from docs_category limit 1";

        sqliteDb.all(sql,function(error,data){

            if(error){
                return RES.errorResponse(res,"抱歉，文档分类新增失败");
            }

            var lastId = data[0].lastId
         
            return RES.successResponse(res,lastId);

        });

    });

 }